<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>emp-toolkit: /Users/wangxiao/git/emp-toolkit/emp-tool/io/net_io_channel.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo-full-doxygen.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">emp-toolkit
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('net__io__channel_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">net_io_channel.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="net__io__channel_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;unistd.h&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;arpa/inet.h&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;sys/types.h&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;netinet/tcp.h&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;netinet/in.h&gt;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;sys/socket.h&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="io__channel_8h.html">io_channel.h</a>&quot;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#ifndef NETWORK_IO_CHANNEL</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#define NETWORK_IO_CHANNEL</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="class_net_i_o.html">   22</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_net_i_o.html">NetIO</a>: <span class="keyword">public</span> <a class="code" href="class_i_o_channel.html">IOChannel</a>&lt;NetIO&gt; { <span class="keyword">public</span>:</div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="class_net_i_o.html#aaf29a7a772f833effe22b18046bd49d2">   23</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_net_i_o.html#aaf29a7a772f833effe22b18046bd49d2">is_server</a>;</div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="class_net_i_o.html#aa1bcbf53f7f2e5b73406647bc31d3ffe">   24</a></span>&#160;    <span class="keywordtype">int</span> mysocket = -1;</div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="class_net_i_o.html#a1c4ee7e5c23e4432b2f77c6a443ce0c0">   25</a></span>&#160;    <span class="keywordtype">int</span> consocket = -1;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="class_net_i_o.html#aeeb2779fd724124234542937361fd4ec">   26</a></span>&#160;    FILE * stream = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="class_net_i_o.html#a28e34fbfa26d41fc047b4f2cf9717336">   27</a></span>&#160;    <span class="keywordtype">char</span> * buffer = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="class_net_i_o.html#a6ca45eba681048394b2cd2288cab3d73">   28</a></span>&#160;    <span class="keywordtype">bool</span> has_sent = <span class="keyword">false</span>;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#ifdef COUNT_IO</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    uint64_t counter = 0;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="class_net_i_o.html#aa8cc94591151e568c8b90cfd75a2eb47">   32</a></span>&#160;    <a class="code" href="class_net_i_o.html#aa8cc94591151e568c8b90cfd75a2eb47">NetIO</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * address, <span class="keywordtype">int</span> <a class="code" href="input-check-malicious_8cpp.html#a63c89c04d1feae07ca35558055155ffb">port</a>) {</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        is_server = (address == <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <span class="keywordflow">if</span> (address == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;            <span class="keyword">struct </span>sockaddr_in dest;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;            <span class="keyword">struct </span>sockaddr_in serv;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;            socklen_t socksize = <span class="keyword">sizeof</span>(<span class="keyword">struct </span>sockaddr_in);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;            memset(&amp;serv, 0, <span class="keyword">sizeof</span>(serv));</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;            serv.sin_family = AF_INET;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;            serv.sin_addr.s_addr = htonl(INADDR_ANY); <span class="comment">/* set our address to any interface */</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;            serv.sin_port = htons(port);           <span class="comment">/* set the server port number */</span>    </div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;            mysocket = socket(AF_INET, SOCK_STREAM, 0);</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;            <span class="keywordtype">int</span> reuse = 1;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;            setsockopt(mysocket, SOL_SOCKET, SO_REUSEADDR, (<span class="keyword">const</span> <span class="keywordtype">char</span>*)&amp;reuse, <span class="keyword">sizeof</span>(reuse));</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            bind(mysocket, (<span class="keyword">struct</span> sockaddr *)&amp;serv, <span class="keyword">sizeof</span>(<span class="keyword">struct</span> sockaddr));</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;            listen(mysocket, 1);</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;            consocket = accept(mysocket, (<span class="keyword">struct</span> sockaddr *)&amp;dest, &amp;socksize);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        }</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <span class="keywordflow">else</span> {</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;            <span class="keyword">struct </span>sockaddr_in dest; </div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            consocket = socket(AF_INET, SOCK_STREAM, 0);</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;            memset(&amp;dest, 0, <span class="keyword">sizeof</span>(dest));</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;            dest.sin_family = AF_INET;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            dest.sin_addr.s_addr = inet_addr(address);</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            dest.sin_port = htons(port);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;            <span class="keywordflow">while</span>(connect(consocket, (<span class="keyword">struct</span> sockaddr *)&amp;dest, <span class="keyword">sizeof</span>(<span class="keyword">struct</span> sockaddr)) == -1) {</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;                usleep(1000);</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;            }</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        }</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment">//      set_nodelay();</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        cout &lt;&lt; <span class="stringliteral">&quot;connected&quot;</span>&lt;&lt;endl;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        stream = fdopen(consocket, <span class="stringliteral">&quot;wb+&quot;</span>);</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        buffer = <span class="keyword">new</span> <span class="keywordtype">char</span>[<a class="code" href="config_8h.html#a4979fa449090ea6181c2f0a91fe512e7">NETWORK_BUFFER_SIZE</a>];</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        memset(buffer, 0, <a class="code" href="config_8h.html#a4979fa449090ea6181c2f0a91fe512e7">NETWORK_BUFFER_SIZE</a>);</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        setvbuf(stream, buffer, _IOFBF, <a class="code" href="config_8h.html#a4979fa449090ea6181c2f0a91fe512e7">NETWORK_BUFFER_SIZE</a>);</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    }</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="class_net_i_o.html#a713464b6b21b4b585e36c108a949637d">   68</a></span>&#160;    <a class="code" href="class_net_i_o.html#a713464b6b21b4b585e36c108a949637d">~NetIO</a>(){</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        fflush(stream);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        close(consocket);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <span class="keyword">delete</span>[] buffer;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    }</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="class_net_i_o.html#a288cc37b49fb37751624122f339772b5">   73</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_net_i_o.html#a288cc37b49fb37751624122f339772b5">sync</a>() {</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <span class="keywordtype">int</span> tmp = 0;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <span class="keywordflow">if</span>(is_server) {</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;            send_data(&amp;tmp, 1);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            recv_data(&amp;tmp, 1);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        }<span class="keywordflow">else</span>{</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            recv_data(&amp;tmp, 1);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            send_data(&amp;tmp, 1);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;            flush();</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        }</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    }</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="class_net_i_o.html#a583679fb7ff58c74375cfb30f457ab45">   84</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_net_i_o.html#a583679fb7ff58c74375cfb30f457ab45">set_nodelay</a>(){</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">int</span> one=1;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        setsockopt(consocket,IPPROTO_TCP,TCP_NODELAY,&amp;one,<span class="keyword">sizeof</span>(one));</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    }</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="class_net_i_o.html#a61981ac0d4d91a96884e0c30999137ff">   89</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_net_i_o.html#a61981ac0d4d91a96884e0c30999137ff">set_delay</a>(){</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">int</span> zero = 0;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        setsockopt(consocket,IPPROTO_TCP,TCP_NODELAY,&amp;zero,<span class="keyword">sizeof</span>(zero));</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    }</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="class_net_i_o.html#aeea2b352b13b9a24418fc0e116e44755">   94</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_net_i_o.html#aeea2b352b13b9a24418fc0e116e44755">flush</a>() {</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        fflush(stream);</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    }</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="class_net_i_o.html#abfdd4bd011b00c9ddeec0f94dd20e441">   98</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_net_i_o.html#abfdd4bd011b00c9ddeec0f94dd20e441">send_data_impl</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> * data, <span class="keywordtype">int</span> len) {</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="preprocessor">#ifdef COUNT_IO</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    counter +=len;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        <span class="keywordtype">int</span> sent = 0;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        <span class="keywordflow">while</span>(sent &lt; len) {</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;            <span class="keywordtype">int</span> res = fwrite(sent+(<span class="keywordtype">char</span>*)data, 1, len-sent, stream);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;            <span class="keywordflow">if</span> (res &gt;= 0)</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                sent+=res;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            <span class="keywordflow">else</span></div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                fprintf(stderr,<span class="stringliteral">&quot;error: net_send_data %d\n&quot;</span>, res);</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        }</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        has_sent = <span class="keyword">true</span>;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    }</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="class_net_i_o.html#a99a38fac8881771d6cfaffef6fca5c2d">  113</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_net_i_o.html#a99a38fac8881771d6cfaffef6fca5c2d">recv_data_impl</a>(<span class="keywordtype">void</span>  * data, <span class="keywordtype">int</span> len) {</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="preprocessor">#ifdef COUNT_IO</span></div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    counter +=len;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        <span class="keywordflow">if</span>(has_sent)</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;            fflush(stream);</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        has_sent = <span class="keyword">false</span>;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keywordtype">int</span> sent = 0;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        <span class="keywordflow">while</span>(sent &lt; len) {</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;            <span class="keywordtype">int</span> res = fread(sent+(<span class="keywordtype">char</span>*)data, 1, len-sent, stream);</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;            <span class="keywordflow">if</span> (res &gt;= 0)</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;                sent+=res;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;            <span class="keywordflow">else</span> </div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;                fprintf(stderr,<span class="stringliteral">&quot;error: net_send_data %d\n&quot;</span>, res);</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        }</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    }</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;};</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="preprocessor">#endif//NETWORK_IO_CHANNEL</span></div><div class="ttc" id="config_8h_html_a4979fa449090ea6181c2f0a91fe512e7"><div class="ttname"><a href="config_8h.html#a4979fa449090ea6181c2f0a91fe512e7">NETWORK_BUFFER_SIZE</a></div><div class="ttdeci">#define NETWORK_BUFFER_SIZE</div><div class="ttdef"><b>Definition:</b> config.h:7</div></div>
<div class="ttc" id="io__channel_8h_html"><div class="ttname"><a href="io__channel_8h.html">io_channel.h</a></div></div>
<div class="ttc" id="class_net_i_o_html_aeea2b352b13b9a24418fc0e116e44755"><div class="ttname"><a href="class_net_i_o.html#aeea2b352b13b9a24418fc0e116e44755">NetIO::flush</a></div><div class="ttdeci">void flush()</div><div class="ttdef"><b>Definition:</b> net_io_channel.h:94</div></div>
<div class="ttc" id="namespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div></div>
<div class="ttc" id="class_net_i_o_html"><div class="ttname"><a href="class_net_i_o.html">NetIO</a></div><div class="ttdef"><b>Definition:</b> net_io_channel.h:22</div></div>
<div class="ttc" id="class_net_i_o_html_aa8cc94591151e568c8b90cfd75a2eb47"><div class="ttname"><a href="class_net_i_o.html#aa8cc94591151e568c8b90cfd75a2eb47">NetIO::NetIO</a></div><div class="ttdeci">NetIO(const char *address, int port)</div><div class="ttdef"><b>Definition:</b> net_io_channel.h:32</div></div>
<div class="ttc" id="class_net_i_o_html_abfdd4bd011b00c9ddeec0f94dd20e441"><div class="ttname"><a href="class_net_i_o.html#abfdd4bd011b00c9ddeec0f94dd20e441">NetIO::send_data_impl</a></div><div class="ttdeci">void send_data_impl(const void *data, int len)</div><div class="ttdef"><b>Definition:</b> net_io_channel.h:98</div></div>
<div class="ttc" id="class_net_i_o_html_aaf29a7a772f833effe22b18046bd49d2"><div class="ttname"><a href="class_net_i_o.html#aaf29a7a772f833effe22b18046bd49d2">NetIO::is_server</a></div><div class="ttdeci">bool is_server</div><div class="ttdef"><b>Definition:</b> net_io_channel.h:23</div></div>
<div class="ttc" id="input-check-malicious_8cpp_html_a63c89c04d1feae07ca35558055155ffb"><div class="ttname"><a href="input-check-malicious_8cpp.html#a63c89c04d1feae07ca35558055155ffb">port</a></div><div class="ttdeci">int port</div><div class="ttdef"><b>Definition:</b> input-check-malicious.cpp:12</div></div>
<div class="ttc" id="class_net_i_o_html_a99a38fac8881771d6cfaffef6fca5c2d"><div class="ttname"><a href="class_net_i_o.html#a99a38fac8881771d6cfaffef6fca5c2d">NetIO::recv_data_impl</a></div><div class="ttdeci">void recv_data_impl(void *data, int len)</div><div class="ttdef"><b>Definition:</b> net_io_channel.h:113</div></div>
<div class="ttc" id="class_net_i_o_html_a61981ac0d4d91a96884e0c30999137ff"><div class="ttname"><a href="class_net_i_o.html#a61981ac0d4d91a96884e0c30999137ff">NetIO::set_delay</a></div><div class="ttdeci">void set_delay()</div><div class="ttdef"><b>Definition:</b> net_io_channel.h:89</div></div>
<div class="ttc" id="class_net_i_o_html_a288cc37b49fb37751624122f339772b5"><div class="ttname"><a href="class_net_i_o.html#a288cc37b49fb37751624122f339772b5">NetIO::sync</a></div><div class="ttdeci">void sync()</div><div class="ttdef"><b>Definition:</b> net_io_channel.h:73</div></div>
<div class="ttc" id="class_i_o_channel_html"><div class="ttname"><a href="class_i_o_channel.html">IOChannel</a></div><div class="ttdef"><b>Definition:</b> io_channel.h:12</div></div>
<div class="ttc" id="class_net_i_o_html_a583679fb7ff58c74375cfb30f457ab45"><div class="ttname"><a href="class_net_i_o.html#a583679fb7ff58c74375cfb30f457ab45">NetIO::set_nodelay</a></div><div class="ttdeci">void set_nodelay()</div><div class="ttdef"><b>Definition:</b> net_io_channel.h:84</div></div>
<div class="ttc" id="class_net_i_o_html_a713464b6b21b4b585e36c108a949637d"><div class="ttname"><a href="class_net_i_o.html#a713464b6b21b4b585e36c108a949637d">NetIO::~NetIO</a></div><div class="ttdeci">~NetIO()</div><div class="ttdef"><b>Definition:</b> net_io_channel.h:68</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_eec959d81771dc8b1a750b834e1341eb.html">emp-tool</a></li><li class="navelem"><a class="el" href="dir_6f7196b439314a1a73bb5510dd78598a.html">io</a></li><li class="navelem"><a class="el" href="net__io__channel_8h.html">net_io_channel.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
  </ul>
</div>
</body>
</html>
